package protobuf {
	import com.netease.protobuf.*;
	use namespace com.netease.protobuf.used_by_generated_code;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	import protobuf.TNMT_TABLE_INFO;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class HSPKG_TNMT_TABLELIST_ACK extends com.netease.protobuf.Message {
		/**
		 *  @private
		 */
		public static const TOURNAMENT_ID:FieldDescriptor$TYPE_UINT64 = new FieldDescriptor$TYPE_UINT64("protobuf.HSPKG_TNMT_TABLELIST_ACK.tournament_id", "tournamentId", (1 << 3) | com.netease.protobuf.WireType.VARINT);

		public var tournamentId:UInt64;

		/**
		 *  @private
		 */
		public static const PAGE:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("protobuf.HSPKG_TNMT_TABLELIST_ACK.page", "page", (2 << 3) | com.netease.protobuf.WireType.VARINT);

		public var page:uint;

		/**
		 *  @private
		 */
		public static const TABLES:RepeatedFieldDescriptor$TYPE_MESSAGE = new RepeatedFieldDescriptor$TYPE_MESSAGE("protobuf.HSPKG_TNMT_TABLELIST_ACK.tables", "tables", (3 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED, protobuf.TNMT_TABLE_INFO);

		[ArrayElementType("protobuf.TNMT_TABLE_INFO")]
		public var tables:Array = [];

		/**
		 *  @private
		 */
		override used_by_generated_code final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT64(output, this.tournamentId);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 2);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT32(output, this.page);
			for (var tables$index:uint = 0; tables$index < this.tables.length; ++tables$index) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 3);
				com.netease.protobuf.WriteUtils.write$TYPE_MESSAGE(output, this.tables[tables$index]);
			}
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override used_by_generated_code final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var tournament_id$count:uint = 0;
			var page$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 1:
					if (tournament_id$count != 0) {
						throw new flash.errors.IOError('Bad data format: HSPKG_TNMT_TABLELIST_ACK.tournamentId cannot be set twice.');
					}
					++tournament_id$count;
					this.tournamentId = com.netease.protobuf.ReadUtils.read$TYPE_UINT64(input);
					break;
				case 2:
					if (page$count != 0) {
						throw new flash.errors.IOError('Bad data format: HSPKG_TNMT_TABLELIST_ACK.page cannot be set twice.');
					}
					++page$count;
					this.page = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
					break;
				case 3:
					this.tables.push(com.netease.protobuf.ReadUtils.read$TYPE_MESSAGE(input, new protobuf.TNMT_TABLE_INFO()));
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
